<%@ page import="java.sql.Connection" %>
<%@ page import="java.sql.DriverManager" %>
<%@ page import="java.sql.Statement" %>
<%@ page import="java.sql.ResultSet" %>
<%--
  Created by IntelliJ IDEA.
  User: 9527
  Date: 2015/5/20
  Time: 21:37
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title></title>
</head>
<body>
<strong>hello jsp</strong>
${actionStr}
<% out.println(new java.util.Date()); %>

<%
    //sql
    Class.forName("com.mysql.jdbc.Driver");
    Connection conn = DriverManager.getConnection(
            "jdbc:mysql://localhost:3306/test", "9527", "9527");
    Statement stmt = conn.createStatement();
    ResultSet rs = stmt.executeQuery("SELECT * from student");
%>

<table bgcolor="#9999dd" border="1" width="300">
    <%
        while (rs.next()) {
    %>
            <tr>
                <td><%=rs.getInt(1)%></td>
                <td><%=rs.getString(2)%></td>
                <td><%=rs.getString(3)%></td>
            </tr>
        <%}%>
</table>
</body>
</html>
